home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 296_01.zip / FLEXSDEF.H < prev    next >
C/C++ Source or Header  |  1993-04-01  |  1KB  |  42 lines

  1. /* macro definitions for compressed-table C/FTL programs generated by flex */
  2.  
  3. #include "flexcom.h"
  4.  
  5. /* reinitializes everything except the current start condition.  The last
  6.  * input character is set to a newline so an initial beginning-of-line
  7.  * rule will match
  8.  */
  9. #define YY_INIT \
  10.     { \
  11.     yyleng = yy_c_buf_p = yy_e_buf_p = 0; \
  12.     yy_hold_char = yy_ch_buf[yy_c_buf_p] = '\n'; \
  13.     yytext = &yy_ch_buf[yy_c_buf_p]; \
  14.     yy_saw_eof = 0; \
  15.     }
  16.  
  17. /* returns the length of the matched text */
  18. #define YY_LENG (yy_c_buf_p - yy_b_buf_p + 1)
  19.  
  20. /* done before the next pattern has been matched action */
  21. #define YY_DO_BEFORE_SCAN \
  22.     yytext[yyleng] = yy_hold_char;
  23.  
  24. /* done after the current pattern has been matched and before the corresponding action */
  25. #define YY_DO_BEFORE_ACTION \
  26.     yytext = &yy_ch_buf[yy_b_buf_p]; \
  27.     yyleng = YY_LENG; \
  28.     yy_hold_char = yytext[yyleng]; \
  29.     yytext[yyleng] = '\0';
  30.  
  31. /* find the next rule matched */
  32. #ifdef FLEX_REJECT_ENABLED
  33. #define REJECT \
  34.         { \
  35.     YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ \
  36.         ++yy_lp; \
  37.         goto find_rule; \
  38.         }
  39. #else
  40. #define REJECT YY_FATAL_ERROR( "REJECT used and scanner was not generated using -r" )
  41. #endif
  42.